<?php

namespace app\index\model;

use think\Model;

class Routers extends Model
{
    public static function init(){
        self::event('before_insert',function($routers){

            $isHas = Routers::where(['id'=>$routers->id])->count();
            if($isHas)
            {
                Routers::where(['id'=>$routers->id])->update($routers->toArray());
                return false;
            }
            return true;
        });
    }
}
